{% extends 'shop/base.html' %}

{% block content %}
    {% for item in user_cart %}
        {% with product=item.product %}
        <p>
            {{ item.quantity }}x {{ product.name|truncatechars:20 }} ${{ item.price }}
            <a href="{% url "cart:remove_product" slug=product.slug %}">Remove</a>
            <form action="{% url "cart:add_product" slug=product.slug %}" method="post">
                {% csrf_token %}
                {{ item.update_quantity }}
                <input type="submit" value="Update">
            </form>
        </p>
        {% endwith %}
    {% endfor %}
{% endblock content %}
